package com.itheima.mapper;

import com.itheima.pojo.entity.OrderSetting;
import com.itheima.pojo.vo.OrderSettingVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDate;
import java.util.Date;
import java.util.List;

@Mapper
public interface OrderSettingMapper {

    @Select("select orderDate,reservations,number from t_ordersetting")
    List<OrderSettingVO> selectAllReservation();

    @Update("UPDATE t_ordersetting SET number = #{number} WHERE orderDate = #{orderDate}")
    void editNumberByOrderDate(OrderSetting orderSetting);

    @Select("select * from t_ordersetting where orderDate between #{firstDay} and #{lastDay}")
    List<OrderSetting> getOrderSettingByMonth(Date firstDay, Date lastDay);
}
